#include "stop_watch.h"

using namespace std;
using namespace chrono;

StopWatch::StopWatch() {
    Reset();
}

StopWatch::~StopWatch() {
}

void StopWatch::Reset() {
    mBegin = high_resolution_clock::now();
}

double StopWatch::Elapsed() const {
    return duration_cast<duration<double>>(high_resolution_clock::now() - mBegin).count();
}

int64_t StopWatch::ElapsedSecond() const {
    return duration_cast<seconds>(high_resolution_clock::now() - mBegin).count();
}

int64_t StopWatch::ElapsedMilli() const {
    return duration_cast<milliseconds>(high_resolution_clock::now() - mBegin).count();
}
